<!-- 引入header模板 start -->
<%include("../common/header.html",{'stageArr':["后台管理员管理","管理员列表"]}){}%>
<!-- 引入header模板 start -->
<script type="text/javascript">
    $(function() {
        $("#workerListTab").tablesorter({
            widgets: ['zebra','columnHighlight','rowHover'],
            headers:{11: { sorter: false}}                                                                       
        });
    });
    function del(userId) {
        if (window.confirm("是否确认删除？删了就真没了哦")) {
            location.href = "${ctxPath}/user/delete/" + userId;
        }
    }
</script>
<table id="workerListTab" class="am-table am-table-bordered am-table-striped am-table-hover tablesorter">
    <thead>
        <tr>
            <th>编号</th>
            <th>用户名</th>
            <th>昵称</th>
            <th>邮箱</th>
            <th>性别</th>
            <th>锁定</th>
            <th>禁用</th>
            <th>审核</th>
            <th>激活</th>
            <th>最后登录时间</th>
            <th>创建时间</th>
            <th>拥有角色</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <% for(user in pageInfo.list){ %>
        <tr>
            <td>${userLP.index}</td>
            <td>${user.username}</td>
            <td>${user.nickname}</td>
            <td>${user.email}</td>
            <td align="center">
                <% if(user.gender == 'F') { %>
                 <span class="am-icon-male"></span>
                <% } else if(user.gender == 'M') { %>
                 <span class="am-icon-female"></span>
                <% } else { %>
                 <span class="am-icon-eye-slash"></span>
                <% } %>
            </td>
            <td align="center">
                <% if(user.isLocked == true) { %>
                 <span class="am-icon-lock"></span>
                <% } else { %>
                 <span class="am-icon-unlock"></span>
                <% } %>
            </td>
            <td align="center">
                <% if(user.isDisabled == true) { %>
                 <span class="am-icon-check"></span>
                <% } else { %>
                 <span class="am-icon-close"></span>
                <% } %>
            </td>
            <td align="center">
                <% if(user.isAudited == true) { %>
                 <span class="am-icon-check"></span>
                <% } else { %>
                 <span class="am-icon-close"></span>
                <% } %>
            </td>
            <td align="center">
                <% if(user.isActivated == true) { %>
                 <span class="am-icon-check"></span>
                <% } else { %>
                 <span class="am-icon-close"></span>
                <% } %>
            </td>
            <td><script type="text/javascript">
                    var time = getLocalTime(${user.lastLoginTime});
                    document.write(time);
                </script>
            </td>
             <td><script type="text/javascript">
                    var time = getLocalTime(${user.createTime});
                    document.write(time);
                 </script>
            </td>
            <td>
                    ${user.roles}
            </td>
            <td>
                <% if(user.username == 'super') { %>
                <% } else { %>
                    <form action="${ctxPath}/user/editUI?id=${user.id}" method="post">
                        <input type="submit"  class="am-btn am-btn-primary am-btn-xs" value="&nbsp;&nbsp;&nbsp;修&nbsp;&nbsp;改&nbsp;&nbsp;&nbsp;"/>
                        <input type="hidden" name="username" value="${user.username}">
                        &nbsp;&nbsp;&nbsp;
                        <button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="del('${user.id}')">
                            <i class="am-icon-trash"></i>&nbsp;&nbsp;&nbsp;删除
                        </button>
                    </form>
                <% } %>
            </td>
        </tr>
        <% } %>
    </tbody>
</table>

<!-- 引入分页模板 start -->
<%include("../common/page.html"){}%>
<!-- 引入分页模板 end -->

<!-- 引入bottom start -->
<%include("../common/bottom.html"){}%>
<!-- 引入bottom end -->